package com.bwie.auth.controller;

import com.bwie.auth.service.AuthService;
import com.bwie.common.domain.User;
import com.bwie.common.domain.response.Jwtresponse;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/User")
public class AuthController {
    @Autowired
    AuthService authService;

    @PostMapping("/loginName")
    public Result<Jwtresponse> loginName(@RequestBody User user){
        Result<Jwtresponse> result=authService.loginName(user);
        return result;
    }

    @GetMapping("/info")
    public Result<User> info(){
        User user=authService.info();
        return Result.success(user);
    }
}
